package com.Brave.manager.Demo02;

import java.util.Properties;
import java.util.Set;

public class Demo07 {
    public static void main(String[] args) {
        Properties prop = new Properties();

        prop.put("001", "张三");
        prop.put("002", "李四");
        prop.put("003", "王五");
        prop.put("004", "赵六");

        Set<Object> keySet = prop.keySet();
        for (Object key : keySet) {
            Object value = prop.get(key);
            System.out.println(key + "," + value);
        }


        //创建集合对象
//        Properties<String,String> prop = new Properties<String,String>(); //错误
//        Properties prop = new Properties();
//
//        //存储元素
//        prop.put("itheima001", "佟丽娅");
//        prop.put("itheima002", "赵丽颖");
//        prop.put("itheima003", "刘诗诗");
//
//        //遍历集合
//        Set<Object> keySet = prop.keySet();
//        for (Object key : keySet) {
//            Object value = prop.get(key);
//            System.out.println(key + "," + value);
//        }
    }
}
